proc proc_init_addstripe {} {
        setViaGenMode -reset
        setViaGenMode -optimize_cross_via  true
        setViaGenMode -allow_via_expansion false
        setViaGenMode -keep_existing_via              2
        setViaGenMode -viarule_preference  {VIAGEN12_PG VIAGEN23_PG VIAGEN34 VIAGEN45 VIAGEN56_RECT VIAGEN67_RECT}

        setAddStripeMode -reset
	setAddStripeMode -ignore_DRC true
        setAddStripeMode -ignore_nondefault_domains true
        setAddStripeMode -use_exact_spacing true
        setAddStripeMode -remove_floating_stapling true
        setAddStripeMode -remove_floating_stripe_over_block false
        setAddStripeMode -stacked_via_top_layer AP -stacked_via_bottom_layer M11
}

# horizontal vertical
proc proc_set_addstripe { layer nets_name start space direction width setToset area uda } {
        addStripe \
        -layer                  $layer \
        -nets                   $nets_name \
        -start_from             bottom \
	    -start                  $start \
        -start_offset           0 \
        -spacing                $space \
        -direction              $direction \
        -width                  $width \
        -set_to_set_distance    $setToset \
        -area                   $area \
        -uda                    $uda
}

proc proc_bump_ap_blk_gen { } {
  set bump_name [dbget top.bumps.name]
  foreach i $bump_name {
    set bump_bbox [dbget [dbget top.bumps.name $i -p].bump_shape_bbox]
    set bump_rbs [dbShape -output rect $bump_bbox SIZEX 2.5]
    createRouteBlk \
                   -Layer       AP \
                   -name           flipchip_AP_blockage \
                   -box            $bump_rbs \
                   -cutlayer RV
  }
}

proc proc_bump_ap_blk_rm {} {
  deleteRouteBlk -Layer AP -name flipchip_AP_blockage
}


proc pr_auto_edit_wire {layer net width pt_list} {
	# M11 VDD 10.5 {{11.2 23.3} {22.3 66.3}}
	uiSetTool select
	uiSetTool addWire
	setEditMode \
		-allow_45_degree true \
		-layer $layer \
		-layer_horizontal $layer \
		-layer_vertical $layer \
		-nets $net \
		-width_horizontal $width \
		-width_vertical $width 
	set a 1
	set len_pt_list [llength $pt_list]
	puts $len_pt_list
	foreach i $pt_list {
		puts $a
		if { $a == $len_pt_list } {
			editCommitRoute $i
		} else {
			editAddRoute $i
		}
		incr a
	}
	uiSetTool select
}